<?php

use Biz\cache\wiki\Union;
use Biz\model\push\PushLogModel;
use Biz\model\store\StoreImagesModel;
use Doraemon\tools\LinkFormat;

ini_set('display_errors', 1);
error_reporting(E_ALL ^ E_NOTICE ^ E_WARNING ^ E_DEPRECATED);
ini_set('memory_limit', '1024M');

require_once '/data/wwwroot/g_vendor/autoload.php';

use Biz\model\store\StoreUserConsult as mUserConsult;
use Biz\service\Store\StoreUserConsult;
use Doraemon\tools\Log;
$where = [];
$where['addtime[>=]'] = date("Y-m-d" , strtotime("-1 day"))." 22:00:00";
$where['addtime[<=]'] = date("Y-m-d" ,)." 09:00:00";
$where['ORDER'] = ['addtime' => 'DESC'];
$info =  mUserConsult::getListByWhere($where);

if($info && is_array($info)){
    $SendInfo  = [];
    foreach($info as $val){
        if(isset($SendInfo[$val['store_id']])) continue;
        $SendInfo[$val['store_id']] = [
            'uid' => $val['uid'],
            'store_id' => $val['store_id']
        ];
    }

    Log::info('门店 SendMsg' , json_encode($SendInfo));


    if($SendInfo && is_array($SendInfo)){
       foreach ($SendInfo as $info){
          StoreUserConsult::_async_sendMsg($info['uid'] , $info['store_id'] ,false);

       }
   }
}else{
    Log::info('门店 SendMsg 无人');
}





